<template>
  <div>
    <van-nav-bar title="仿QQMusic"  left-arrow>
          <template #left>
        <van-icon name="https://y.qq.com/mediastyle/mod/mobile/img/logo.svg" size="20" />
      </template>
      <template #right>
   <van-icon name="user-o" size="20" />
      </template>
    </van-nav-bar>
    <van-tabs v-model="active" animated class="tabs" v-show="showTabs">
      <van-tab title="推荐" to="/Recommend" />
      <van-tab title="排行" to="/Tops" />
    </van-tabs>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  data() {
    return {
      active: 0,
    };
  },
  computed: {
    ...mapState({
      showTabs: "showTabs",
    }),
  },
  created(){
    let name=this.$route.name;
    if(name=="Recommend"){
      this.active=0;
    }
    else{
      this.active=1;
    }
   
  }
};
</script>

<style>

</style>